package com.link2room.ironhide.config;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.MultipartConfigElement;

/**
 * Created by LN on 2016/11/28.
 */
@Configuration
public class UploadConfiguration {
    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
//        factory.setFileSizeThreshold();
        factory.setMaxFileSize("3MB");
        factory.setMaxRequestSize("3MB");
        return factory.createMultipartConfig();
    }
}
